package architect;

import java.util.function.Predicate;

/**
 * @title: JavaPredicate
 * @description:
 * @author: guanxin
 * @date: 2019-11-09 11:37
 * @since: Jdk8
 */

public class JavaPredicate {

    public static void main(String[] args) {
        System.out.println(test1.test(-1));
        System.out.println(test1.negate().test(100));
        System.out.println(test1.and(test2).test(100));
        System.out.println(test1.or(test2).test(100));
        System.out.println(Predicate.isEqual("").test(""));
        Person person1 = new Person();
        Person person2 = new Person();
        System.out.println(Predicate.isEqual(person1).test(person2));
    }

    private static Predicate<Integer> test1 = t -> t > 0;
    private static Predicate<Integer> test2 = t -> t == 0;
}
